package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.TenantYqdaDocument;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zjj
 * @date 2023/6/15
 */
public interface TenantYqdaDocumentMapper {
    /**
     * 创建电子文件总表
     * @param yqdaDocument
     * @return
     */
    int createYqdaDocumentTable(TenantYqdaDocument yqdaDocument);

    String MaxOrderNo(TenantYqdaDocument yqdaDocument);

    int insertDocument(TenantYqdaDocument oploadDoc);

    List<Map<String,Object>> getefilebydaid(@Param("daid") Long daid, @Param("efiletable")String efiletable, @Param("fields")String fields);

    String gettablenamebydaid(@Param("daid")Long daid, @Param("allftable")String allftable, @Param("catetablename")String catetablename);

    TenantYqdaDocument selectnameandpathbyDocid(@Param("docId")Long docId, @Param("efiletable") String efiletable);

    int updateDocument(TenantYqdaDocument document);

    Map<String, Object> getDocumentById(@Param("column") String column, @Param("id") Long id, @Param("efileTableName") String efileTableName);

    int delDocument(@Param("ids")Long[] ids, @Param("efileTableName") String efileTableName);

    List<Map<String, Object>> getDocumentBydaId(@Param("fields")String fields, @Param("daId") Long daId, @Param("efileTableName") String efileTableName,@Param("orderstr") String orderstr);

    List<Map<String, Object>> getAllDoc(@Param("fields")String fields, @Param("whereMap") Map<String,String> whereMap, @Param("efileTableName") String efileTableName);

    TenantYqdaDocument viewByDocid(@Param("docId")Long docId, @Param("efiletable") String efiletable, @Param("yqdatransdocTbale")String yqdatransdocTbale);

    List<TenantYqdaDocument> selectNotYqdatransdoc(@Param("eFileTable")List<String> eFileTable, @Param("tableName") String tableName, @Param("filename")String filename, @Param("houzhui")String houzhui);

    TenantYqdaDocument getPathByConTableId(@Param("con_table_id")Long con_table_id, @Param("type")Integer type, @Param("efiletable")String efiletable);

    List<Map<String, Object>> getAllDocByDa(@Param("fields")String fields, @Param("whereMap")  Map<String, String> map, @Param("efileTableName")  String efileTableName, @Param("fileTableName") String fileTableName, @Param("size") Long size);

    Map<String, Object> getDocumentMessageById(@Param("column")String fields, @Param("id") Long id, @Param("efileTableName") String efileTableName, @Param("fileTableName") String fileTableName);

    List<Map<String, Object>> getAllDocByDaQuery(@Param("fields")String fields, @Param("query")String query, @Param("efileTableName")  String efileTableName, @Param("fileTableName") String fileTableName, @Param("size") Long size);

    void updateIndex(@Param("code") String tenantCode, @Param("daId") String con_table_id);

    int delDocByIdList(@Param("efileTableName")String efileTableName,@Param("ids") List<Long> ids);

    List<TenantYqdaDocument> getDocumentListAll(TenantYqdaDocument document);
}
